package kg.aibek.projecteuler.p10;

public class Problem40 {
	public void solve() {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < 1000000; i++) {
			sb.append(i);
		}

		int prod = 1;
		for (int i = 1; i <= 1000000; i = i * 10) {
			prod *= new Integer(sb.charAt(i) + "");
		}

		System.out.println(prod);
	}

	public static void main(String[] args) {
		Problem40 p = new Problem40();
		p.solve();
	}
}
